package com.lin.mybatis.dao;

import com.lin.mybatis.entity.User;
import org.apache.ibatis.annotations.MapKey;

import java.util.List;
import java.util.Map;

/**
 * @author : linwen
 * @date : 下午2:23 2021/10/6
 */
public interface UserDao {

    public User getUserById(Integer id);

    public int insertUser(User user);

    public long updateUserById(User user);

    public boolean deleteUserById(int id);

    //  不指定key，默认以属性名作为key。返回值为map
    public Map<String,Object> getUserByIdReturnMap(Integer id);

    // mapkey指定了返回map的key，value为包装对象
    @MapKey("id")
    public Map<String,User> getUserReturnKeyMap();

    List<User> getUsers();
}
